]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
animation: Reload sliced texture on global scale change
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 27 Feb 2019 01:08:26 +0000 (02:08 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 1 Mar 2019 17:12:53 +0000 (17:12 +0000)
When the scale has changed we need to reload the texture at proper size.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5

js/ui/animation.js

index 0d711567fdfcd957077dae355bfd81017bb8b3a7..c21b225650d83cc565b5e704a277c7b3cf142cb4 100644 (file)
@@ -18,6 +18,10 @@ var Animation = class {
         this.actor.connect('resource-scale-changed',
             this._loadFile.bind(this, file, width, height));
 
+        let themeContext = St.ThemeContext.get_for_stage(global.stage);
+        this._scaleChangedId = themeContext.connect('notify::scale-factor',
+            this._loadFile.bind(this, file, width, height));
+
         this._speed = speed;
 
         this._isLoaded = false;
@@ -104,6 +108,11 @@ var Animation = class {
 
     _onDestroy() {
         this.stop();
+
+        let themeContext = St.ThemeContext.get_for_stage(global.stage);
+        if (this._scaleChangedId)
+            themeContext.disconnect(this._scaleChangedId);
+        this._scaleChangedId = 0;
     }
 };